import numpy as np
import pandas as pd
df5 = pd.DataFrame(np.arange(12).reshape(4,3),index= list('abcd'),columns=list('xyz'))
df5.iloc[1:3,0:2] = np.nan
df5.iloc[2,2] = np.nan
print(df5)

a=df5.fillna(value=df5.mean())
print(a)
